package state.improve;

import lombok.Getter;
import lombok.Setter;
import state.improve.states.CloseState;
import state.improve.states.OpenState;
import state.improve.states.RunState;
import state.improve.states.StopState;

@Setter
@Getter
public class ElevatorManager {
    private State openState;
    private State closeState;
    private State runState;
    private State stopState;

    private State state;

    public ElevatorManager() {
        this.openState = new OpenState(this);
        this.closeState = new CloseState(this);
        this.runState = new RunState(this);
        this.stopState = new StopState(this);
        this.state = this.stopState;
    }

    public void open() {
        state.open();
    }

    public void run() {
        state.run();
    }

    public void stop() {
        state.stop();
    }

    public void close() {
        state.close();
    }
}
